/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.account.Key.DistributionListBy;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.account.Group;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.message.ModifyDistributionListRequest;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ModifyDistributionList
/*    */   extends DistributionListDocumentHandler
/*    */ {
/*    */   public boolean domainAuthSufficient(Map context)
/*    */   {
/* 43 */     return true;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public boolean defendsAgainstDelegateAdminAccountHarvesting()
/*    */   {
/* 51 */     return true;
/*    */   }
/*    */   
/*    */   protected Group getGroup(Element request) throws ServiceException
/*    */   {
/* 56 */     String id = request.getAttribute("id");
/* 57 */     return Provisioning.getInstance().getGroup(Key.DistributionListBy.id, id);
/*    */   }
/*    */   
/*    */ 
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 64 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 65 */     Provisioning prov = Provisioning.getInstance();
/* 66 */     ModifyDistributionListRequest req = (ModifyDistributionListRequest)JaxbUtil.elementToJaxb(request);
/* 67 */     String id = req.getId();
/* 68 */     Group group = getGroupFromContext(context);
/*    */     
/* 70 */     Map<String, Object> attrs = req.getAttrsAsOldMultimap();
/* 71 */     defendAgainstGroupHarvesting(group, Key.DistributionListBy.id, id, zsc, attrs, attrs);
/*    */     
/*    */ 
/* 74 */     prov.modifyAttrs(group, attrs, true);
/*    */     
/* 76 */     ZimbraLog.security.info(ZimbraLog.encodeAttrs(new String[] { "cmd", "ModifyDistributionList", "name", group.getName() }, attrs));
/*    */     
/*    */ 
/* 79 */     Element response = zsc.createElement(AdminConstants.MODIFY_DISTRIBUTION_LIST_RESPONSE);
/* 80 */     GetDistributionList.encodeDistributionList(response, group);
/* 81 */     return response;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 86 */     notes.add(String.format("All attrs provided in the attribute list have to settable by. the authed admin.   You can grant the %s right, which allows setting all attributes on %s, or grant the set attrs right just for the attributes the admin needs to set while creating an entry.", new Object[] { Rights.Admin.R_modifyDistributionList.getName(), "distribution list" }));
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/ModifyDistributionList.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */